package com.yupi.springbootinit.controller;

import cn.hutool.core.io.FileUtil;
import com.baidubce.appbuilder.base.exception.AppBuilderServerException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yupi.springbootinit.annotation.AuthCheck;
import com.yupi.springbootinit.bimq.BiMyMessageProducer;
import com.yupi.springbootinit.common.BaseResponse;
import com.yupi.springbootinit.common.DeleteRequest;
import com.yupi.springbootinit.common.ErrorCode;
import com.yupi.springbootinit.common.ResultUtils;
import com.yupi.springbootinit.constant.CommonConstant;
import com.yupi.springbootinit.constant.UserConstant;
import com.yupi.springbootinit.exception.BusinessException;
import com.yupi.springbootinit.exception.ThrowUtils;
import com.yupi.springbootinit.model.dto.ai.AiResponse;
import com.yupi.springbootinit.model.dto.chart.*;
import com.yupi.springbootinit.model.entity.Chart;
import com.yupi.springbootinit.model.entity.User;
import com.yupi.springbootinit.model.enums.FileUploadBizEnum;
import com.yupi.springbootinit.service.ChartService;
import com.yupi.springbootinit.service.UserService;
import com.yupi.springbootinit.service.impl.AiManager;
import com.yupi.springbootinit.service.impl.BaiDuAiManager;
import com.yupi.springbootinit.utils.ExcelUtil;
import com.yupi.springbootinit.utils.SqlUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 图表接口
 */
@RestController
@RequestMapping("/chart")
@Slf4j
public class ChartController {

    @Resource
    private ChartService chartService;

    @Resource
    private UserService userService;

    @Resource
    private AiManager aiManager;

    @Resource
    private BaiDuAiManager baiDuAiManager;
    @Resource
    private ThreadPoolExecutor threadPoolExecutor;
    @Resource
    private BiMyMessageProducer biMyMessageProducer;

    // region 增删改查

    /**
     * 创建
     *
     * @param chartAddRequest
     * @param request
     * @return
     */
    @PostMapping("/add")
    public BaseResponse<Long> addChart(@RequestBody ChartAddRequest chartAddRequest, HttpServletRequest request) {
        if (chartAddRequest == null) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        return ResultUtils.success(chartService.saveChart(chartAddRequest, request));
    }

    /**
     * 删除
     *
     * @param deleteRequest
     * @param request
     * @return
     */
    @PostMapping("/delete")
    public BaseResponse<Long> deleteChart(@RequestBody DeleteRequest deleteRequest, HttpServletRequest request) {
        if (deleteRequest == null || deleteRequest.getId() <= 0) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }

        long l = chartService.deleteChart(deleteRequest, request);
        ThrowUtils.throwIf(l <= 0, ErrorCode.PARAMS_ERROR);
        return ResultUtils.success(l);
    }

    /**
     * 更新（仅管理员）
     *
     * @param chartUpdateRequest
     * @return
     */
    @PostMapping("/update")
    @AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
    public BaseResponse<Integer> updateChart(@RequestBody ChartUpdateRequest chartUpdateRequest) {
        extracted(chartUpdateRequest);
        int i = chartService.updateChart(chartUpdateRequest);
        return ResultUtils.success(i);
    }

    private static void extracted(ChartUpdateRequest chartUpdateRequest) {
        if (chartUpdateRequest == null || chartUpdateRequest.getId() <= 0) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
    }

    /**
     * 智普ai
     *
     * @param multipartFile
     * @param genChartByAiRequest
     * @param request
     * @return
     * @throws IOException 已放弃使用
     */

    //@PostMapping("/gen")
    public BaseResponse<AiResponse> chartByAi(@RequestPart("file") MultipartFile multipartFile,
                                              GenChartByAiRequest genChartByAiRequest, HttpServletRequest request) throws IOException {
        // todo 用户上传一个超大文件怎么办
        // todo 用户疯狂点提交按钮
        // todo AI生成得太慢，同时有很多用户提交生成，系统产生巨大压力，怎样兼顾用户得体验感和系统得可用性
        String goal = genChartByAiRequest.getGoal();
        String chartType = genChartByAiRequest.getChartType();
        String name = genChartByAiRequest.getName();
        // 校验
        ThrowUtils.throwIf(StringUtils.isBlank(goal), ErrorCode.PARAMS_ERROR, "输入目标为空");
        ThrowUtils.throwIf(StringUtils.isBlank(name) || name.length() > 100, ErrorCode.PARAMS_ERROR, "名称过长");
        // 校验文件
        long size = multipartFile.getSize();
        String filename = multipartFile.getOriginalFilename();
        final long One_MB = 1024 * 1024L;
        ThrowUtils.throwIf(size > One_MB, ErrorCode.PARAMS_ERROR, "文件大小超过1MB");
        // 校验文件后缀
        String suffix = FileUtil.getSuffix(filename);
        List<String> list = Arrays.asList("xlsx", "xls", "csv");
        if (!list.contains(suffix)) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件类型错误");
        }
        // 读取用户上传的excel
        StringBuilder builder = new StringBuilder();
        // 预设角色
        builder.append("你是一个数据分析师，接下来我给你我的分析目标和原始数据，请告诉我你的结论").append("\n");
        //分析目标
        builder.append("分析需求：").append("\n");
        String useGoal = goal;
        if (StringUtils.isNotBlank(chartType)) {
            useGoal += ",请使用" + chartType;
        }
        builder.append(useGoal).append("\n");
        // 压缩后的数据
        String toCSV = ExcelUtil.excelToCSV(multipartFile);
        builder.append("数据:").append(toCSV).append("\n");
        // 返回prompt
        /*
         Echarts 代码
         【【【
         结论
         */
        builder.append("请根据上述部分，按照下列格式生成内容").append("\n");
        builder.append("option:{EChart V5的option配置对象js代码,不要有多余注释}").append("\n");
        builder.append("【【【").append("\n");
        builder.append("result:{明确的数据分析结论,不要有多余注释}").append("\n");

        AiResponse chartResponse = aiManager.AiChart(builder.toString());
        // 数据库添加数据
        Chart chart = new Chart();
        chart.setGoal(goal);
        chart.setChartType(chartType);
        // 图表数据
        chart.setGenChart(chartResponse.getChartOption());
        // 结论
        chart.setGenResult(chartResponse.getChartConclusion());
        User loginUser = userService.getLoginUser(request);
        chart.setUserId(loginUser.getId());
        chart.setName(name);
        boolean save = chartService.save(chart);
        ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR, "插入失败！！");
        //调用ai,返回数据
        return ResultUtils.success(chartResponse);
    }


    /**
     * 异步 百度AI智能分析 rabbitMQ实现
     * @param multipartFile
     * @param genChartByAiRequest
     * @param request
     * @return
     * @throws IOException
     * @throws AppBuilderServerException
     */

    @PostMapping("/baidugenAsync/mq")
    public BaseResponse<AiResponse> chartByBaiduAiMQAsync(@RequestPart("file") MultipartFile multipartFile,
                                                        GenChartByAiRequest genChartByAiRequest, HttpServletRequest request) throws IOException, AppBuilderServerException {
        // todo 用户上传一个超大文件怎么办
        // todo 用户疯狂点提交按钮
        // todo AI生成得太慢，同时有很多用户提交生成，系统产生巨大压力，怎样兼顾用户得体验感和系统得可用性
        String goal = genChartByAiRequest.getGoal();
        String chartType = genChartByAiRequest.getChartType();
        String name = genChartByAiRequest.getName();
        // 校验
        ThrowUtils.throwIf(StringUtils.isBlank(goal), ErrorCode.PARAMS_ERROR, "输入目标为空");
        ThrowUtils.throwIf(StringUtils.isBlank(name) || name.length() > 100, ErrorCode.PARAMS_ERROR, "名称过长");
        // 校验文件
        long size = multipartFile.getSize();
        String filename = multipartFile.getOriginalFilename();
        final long One_MB = 1024 * 1024L;
        ThrowUtils.throwIf(size > One_MB, ErrorCode.PARAMS_ERROR, "文件大小超过1MB");
        // 校验文件后缀
        String suffix = FileUtil.getSuffix(filename);
        List<String> list = Arrays.asList("xlsx", "xls");
        if (!list.contains(suffix)) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件类型错误");
        }
        // 读取用户上传的excel
        StringBuilder builder = new StringBuilder();
        // 预设角色
        builder.append("你是一个数据分析师，接下来我给你我的分析目标和原始数据，请告诉我你的结论").append("\n");
        //分析目标
        builder.append("分析需求：").append("\n");
        String useGoal = goal;
        if (StringUtils.isNotBlank(chartType)) {
            useGoal += ",请使用" + chartType;
        }
        builder.append(useGoal).append("\n");
        // 压缩后的数据
        String toCSV = ExcelUtil.excelToCSV(multipartFile);
        builder.append("数据:").append(toCSV).append("\n");
        // 数据库添加数据
        Chart chart = new Chart();
        chart.setGoal(goal);
        chart.setChartType(chartType);
        chart.setName(name);
        chart.setChartData(toCSV);
        chart.setStatus("wait");
        chart.setUserId(userService.getLoginUser(request).getId());
        boolean save = chartService.save(chart);
        ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR, "插入失败！！");
        Long id = chart.getId();
        // 发送mq消息
        biMyMessageProducer.sendMessage(String.valueOf(id));
        AiResponse response = new AiResponse();
        response.setChartId(String.valueOf(chart.getId()));
        return ResultUtils.success(response);
    }



    /**
     * 异步 百度AI智能分析
     *
     * @param multipartFile
     * @param genChartByAiRequest
     * @param request
     * @return
     * @throws IOException
     * @throws AppBuilderServerException
     */
    @PostMapping("/baidugenAsync")
    public BaseResponse<AiResponse> chartByBaiduAiAsync(@RequestPart("file") MultipartFile multipartFile,
                                                        GenChartByAiRequest genChartByAiRequest, HttpServletRequest request) throws IOException, AppBuilderServerException {
        // todo 用户上传一个超大文件怎么办
        // todo 用户疯狂点提交按钮
        // todo AI生成得太慢，同时有很多用户提交生成，系统产生巨大压力，怎样兼顾用户得体验感和系统得可用性
        String goal = genChartByAiRequest.getGoal();
        String chartType = genChartByAiRequest.getChartType();
        String name = genChartByAiRequest.getName();
        // 校验
        ThrowUtils.throwIf(StringUtils.isBlank(goal), ErrorCode.PARAMS_ERROR, "输入目标为空");
        ThrowUtils.throwIf(StringUtils.isBlank(name) || name.length() > 100, ErrorCode.PARAMS_ERROR, "名称过长");
        // 校验文件
        long size = multipartFile.getSize();
        String filename = multipartFile.getOriginalFilename();
        final long One_MB = 1024 * 1024L;
        ThrowUtils.throwIf(size > One_MB, ErrorCode.PARAMS_ERROR, "文件大小超过1MB");
        // 校验文件后缀
        String suffix = FileUtil.getSuffix(filename);
        List<String> list = Arrays.asList("xlsx", "xls");
        if (!list.contains(suffix)) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件类型错误");
        }
        // 读取用户上传的excel
        StringBuilder builder = new StringBuilder();
        // 预设角色
        builder.append("你是一个数据分析师，接下来我给你我的分析目标和原始数据，请告诉我你的结论").append("\n");
        //分析目标
        builder.append("分析需求：").append("\n");
        String useGoal = goal;
        if (StringUtils.isNotBlank(chartType)) {
            useGoal += ",请使用" + chartType;
        }
        builder.append(useGoal).append("\n");
        // 压缩后的数据
        String toCSV = ExcelUtil.excelToCSV(multipartFile);
        builder.append("数据:").append(toCSV).append("\n");
        // 数据库添加数据
        Chart chart = new Chart();
        chart.setGoal(goal);
        chart.setChartType(chartType);
        chart.setName(name);
        chart.setChartData(toCSV);
        chart.setStatus("wait");
        chart.setUserId(userService.getLoginUser(request).getId());
        boolean save = chartService.save(chart);
        ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR, "插入失败！！");

        CompletableFuture.runAsync(() -> {
            String[] strings = null;
            Chart updateChart = new Chart();
            updateChart.setId(chart.getId());
            updateChart.setStatus("running");
            boolean b = chartService.updateById(updateChart);
            ThrowUtils.throwIf(!b, ErrorCode.PARAMS_ERROR, "执行状态更改失败");
            try {
                String result = BaiDuAiManager.BaiDuAiChart(builder.toString());
                strings = result.split("【【【【【");
                if(strings.length < 3){
                    throw new BusinessException(ErrorCode.OPERATION_ERROR,"AI生成失败");
                }

            } catch (IOException | AppBuilderServerException e) {
                log.error("异步生成{}", e.getMessage());
            }
            ThrowUtils.throwIf(strings == null, ErrorCode.PARAMS_ERROR, "结论图表为空");
            // 提取 data 部分
            String option = strings[1].split("【【【【【")[0].trim();
            // 提取 conclusion 部分
            String conclusion = strings[2].trim();
            ObjectMapper objectMapper = new ObjectMapper();
            JsonNode jsonNode = null;
            try {
                jsonNode = objectMapper.readTree(option);
            } catch (JsonProcessingException e) {
                log.error("json 格式更改失败");
            }
            assert jsonNode != null;
            String chartOption = jsonNode.toPrettyString();
            // 得到结果 状态改为 succeed
            Chart updateChartResult = new Chart();
            updateChartResult.setId(chart.getId());
            updateChartResult.setStatus("succeed");
            updateChartResult.setGenChart(chartOption);
            updateChartResult.setGenResult(conclusion);
            boolean bl = chartService.updateById(updateChartResult);
            ThrowUtils.throwIf(!bl, ErrorCode.PARAMS_ERROR, "执行状态更改失败");

        }, threadPoolExecutor);
        AiResponse response = new AiResponse();
        response.setChartId(String.valueOf(chart.getId()));
        return ResultUtils.success(response);
    }


    /**
     * 同步
     * 百度AI智能分析
     *
     * @param multipartFile
     * @param genChartByAiRequest
     * @param request
     * @return
     */
    /*
        输入:
            系统预设(提前告诉他职责、功能回复格式要求) + 分析目标 + 压缩后的数据
        最简单的系统预设:
            你是一个数据分析师,接下来我会给你我的分析目标和原始数据，请告诉我分析结论。
        AI提词技巧3:
            在系统(模型)层面做预设效果一般来说，蚍直接拼接在用户消息里效果更好一些。
        AI提词技巧4:
            除了系统预设外,额外关联一问一答两条消息，相当于给Al一个提示
         */
    // todo  限流器 限制频繁访问接口
    @PostMapping("/baidugen")
    public BaseResponse<AiResponse> chartByBaiduAi(@RequestPart("file") MultipartFile multipartFile,
                                               GenChartByAiRequest genChartByAiRequest, HttpServletRequest request) throws IOException, AppBuilderServerException {
        // todo 用户上传一个超大文件怎么办
        // todo 用户疯狂点提交按钮
        // todo AI生成得太慢，同时有很多用户提交生成，系统产生巨大压力，怎样兼顾用户得体验感和系统得可用性
        String goal = genChartByAiRequest.getGoal();
        String chartType = genChartByAiRequest.getChartType();
        String name = genChartByAiRequest.getName();
        // 校验
        ThrowUtils.throwIf(StringUtils.isBlank(goal), ErrorCode.PARAMS_ERROR, "输入目标为空");
        ThrowUtils.throwIf(StringUtils.isBlank(name) || name.length() > 100, ErrorCode.PARAMS_ERROR, "名称过长");
        // 校验文件
        long size = multipartFile.getSize();
        String filename = multipartFile.getOriginalFilename();
        final long One_MB = 1024 * 1024L;
        ThrowUtils.throwIf(size > One_MB, ErrorCode.PARAMS_ERROR, "文件大小超过1MB");
        // 校验文件后缀
        String suffix = FileUtil.getSuffix(filename);
        List<String> list = Arrays.asList("xlsx", "xls");
        if (!list.contains(suffix)) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件类型错误");
        }
        // 读取用户上传的excel
        StringBuilder builder = new StringBuilder();
        // 预设角色
        //builder.append("你是一个数据分析师，接下来我给你我的分析目标和原始数据，请告诉我你的结论").append("\n");
        //分析目标
        builder.append("分析需求：").append("\n");
        String useGoal = goal;
        if (StringUtils.isNotBlank(chartType)) {
            useGoal += ",请使用" + chartType;
        }
        builder.append(useGoal).append("\n");
        // 压缩后的数据
        String toCSV = ExcelUtil.excelToCSV(multipartFile);
        builder.append("数据:").append(toCSV).append("\n");
        String result = BaiDuAiManager.BaiDuAiChart(builder.toString());
        // 提取 data 部分
        String option = result.split("【【【【【")[1].split("【【【【【")[0].trim();
        // 提取 conclusion 部分
        String conclusion = result.split("【【【【【")[2].trim();
        // 数据库添加数据
        Chart chart = new Chart();
        chart.setGoal(goal);
        chart.setChartType(chartType);
        chart.setName(name);
        chart.setChartData(toCSV);
        chart.setUserId(userService.getLoginUser(request).getId());
//        ObjectMapper objectMapper = new ObjectMapper();
//        JsonNode jsonNode = objectMapper.readTree(option);
//        String chartOption = jsonNode.toPrettyString();
        chart.setGenChart(option);
        chart.setGenResult(conclusion);
        AiResponse response = new AiResponse();
        response.setChartId(String.valueOf(chart.getId()));
        response.setChartOption(option);
        response.setChartConclusion(conclusion);
        boolean save = chartService.save(chart);
        ThrowUtils.throwIf(!save, ErrorCode.OPERATION_ERROR, "插入失败！！");
        return ResultUtils.success(response);
    }

    /**
     * 校验文件
     *
     * @param multipartFile
     * @param fileUploadBizEnum 业务类型
     */
    public void validFile(MultipartFile multipartFile, FileUploadBizEnum fileUploadBizEnum) {
        // 文件大小
        long fileSize = multipartFile.getSize();
        // 文件后缀
        String fileSuffix = FileUtil.getSuffix(multipartFile.getOriginalFilename());
        final long ONE_M = 1024 * 1024L;
        if (FileUploadBizEnum.USER_AVATAR.equals(fileUploadBizEnum)) {
            if (fileSize > ONE_M) {
                throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件大小不能超过 1M");
            }
            if (!Arrays.asList("jpeg", "jpg", "svg", "png", "webp").contains(fileSuffix)) {
                throw new BusinessException(ErrorCode.PARAMS_ERROR, "文件类型错误");
            }
        }
    }

    /**
     * 根据 id 获取
     *
     * @param id
     * @return
     */
    @GetMapping("/get")
    public BaseResponse<Chart> getChartById(long id) {
        if (id <= 0) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        Chart chart = chartService.getById(id);
        if (chart == null) {
            throw new BusinessException(ErrorCode.NOT_FOUND_ERROR);
        }
        return ResultUtils.success(chart);
    }

    /**
     * 分页获取列表（封装类）
     *
     * @param chartQueryRequest
     * @param request
     * @return
     */
    @PostMapping("/list/page")
    public BaseResponse<Page<Chart>> listChartByPage(@RequestBody ChartQueryRequest chartQueryRequest,
                                                     HttpServletRequest request) {
        long current = chartQueryRequest.getCurrent();
        long size = chartQueryRequest.getPageSize();
        // 限制爬虫
        ThrowUtils.throwIf(size > 20, ErrorCode.PARAMS_ERROR);
        Page<Chart> chartPage = chartService.page(new Page<>(current, size),
                getQueryWrapper(chartQueryRequest));
        return ResultUtils.success(chartPage);
    }

    /**
     * 分页获取当前用户创建的资源列表
     *
     * @param chartQueryRequest
     * @param request
     * @return
     */
    @PostMapping("/my/list/page")
    public BaseResponse<Page<Chart>> listMyChartByPage(@RequestBody ChartQueryRequest chartQueryRequest,
                                                       HttpServletRequest request) {
        if (chartQueryRequest == null) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        User loginUser = userService.getLoginUser(request);
        chartQueryRequest.setUserId(loginUser.getId());
        long current = chartQueryRequest.getCurrent();
        long size = chartQueryRequest.getPageSize();
        // 限制爬虫
        ThrowUtils.throwIf(size > 20, ErrorCode.PARAMS_ERROR);
        Page<Chart> chartPage = chartService.page(new Page<>(current, size),
                getQueryWrapper(chartQueryRequest));
        return ResultUtils.success(chartPage);
    }

    // endregion

    /**
     * 编辑（用户）
     *
     * @param chartEditRequest
     * @param request
     * @return
     */
    @PostMapping("/edit")
    public BaseResponse<Boolean> editChart(@RequestBody ChartEditRequest chartEditRequest, HttpServletRequest request) {
        if (chartEditRequest == null || chartEditRequest.getId() <= 0) {
            throw new BusinessException(ErrorCode.PARAMS_ERROR);
        }
        Chart chart = new Chart();
        BeanUtils.copyProperties(chartEditRequest, chart);
        User loginUser = userService.getLoginUser(request);
        long id = chartEditRequest.getId();
        // 判断是否存在
        Chart oldChart = chartService.getById(id);
        ThrowUtils.throwIf(oldChart == null, ErrorCode.NOT_FOUND_ERROR);
        // 仅本人或管理员可编辑
        if (!oldChart.getUserId().equals(loginUser.getId()) && !userService.isAdmin(loginUser)) {
            throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
        }
        boolean result = chartService.updateById(chart);
        return ResultUtils.success(result);
    }

    // endregion

    /**
     * 获取查询包装类
     *
     * @param chartQueryRequest
     * @return
     */
    private QueryWrapper<Chart> getQueryWrapper(ChartQueryRequest chartQueryRequest) {
        QueryWrapper<Chart> queryWrapper = new QueryWrapper<>();
        if (chartQueryRequest == null) {
            return queryWrapper;
        }
        Long id = chartQueryRequest.getId();
        String name = chartQueryRequest.getName();
        String goal = chartQueryRequest.getGoal();
        String chartType = chartQueryRequest.getChartType();
        Long userId = chartQueryRequest.getUserId();
        String sortField = chartQueryRequest.getSortField();
        String sortOrder = chartQueryRequest.getSortOrder();

        queryWrapper.eq(id != null && id > 0, "id", id);
        queryWrapper.like(StringUtils.isNotBlank(name), "name", name);
        queryWrapper.eq(StringUtils.isNotBlank(goal), "goal", goal);
        queryWrapper.eq(StringUtils.isNotBlank(chartType), "chartType", chartType);
        queryWrapper.eq(ObjectUtils.isNotEmpty(userId), "userId", userId);
        queryWrapper.eq("isDelete", false);
        queryWrapper.orderBy(SqlUtils.validSortField(sortField), sortOrder.equals(CommonConstant.SORT_ORDER_ASC),
                sortField);
        return queryWrapper;
    }
}

